<?php
echo $this->Html->docType();
?>
<html>
<head>
<?php print $this->Html->charset('utf-8') ?>
<title><?php print $title_for_layout; ?></title>
<?php
print $this->Html->meta('favicon.ico', $this->Html->url('/favicon.ico'), array('type' => 'icon'));
?>
<?php
   print $this->Html->css('laksmi.css?v=131227', 'stylesheet', array('media'=>'screen'));
	print $this->Html->css('jquery-ui-1.10.3.custom', 'stylesheet', array('media'=>'screen'));
   print $this->Html->css('laksmi.print', 'stylesheet', array('media'=>'print'));

   print $this->Html->script('prototype');
   print $this->Html->script('scriptaculous');
	print $this->Html->script('notify');
   print $this->Html->script('inputmask');

	print $this->Html->script('jquery-2.0.3.min');
	//a noconfilct közvetlenül ez után kell
?>

	<script>
		var $jQ = jQuery.noConflict();		// $jQ is now an alias to the jQuery function; creating the new alias is optional.
	</script>

<?php
	print $this->Html->script('jquery-ui-1.10.3.custom.min');
	print $this->Html->script('jquery.noty.packaged.min');
	print $this->Html->script('jquery.easydate');
	print $this->Html->script('jquery.easynumber');
	//print $this->Html->script('jquery.rStorage.min.js');
	print $this->Html->script('jquery.rStorage.js');
	
	print $this->Html->script('laksmi.js');
	print $this->Html->script('laksmi.autocompletefactory.js');
   print $this->fetch('script');
?>
</head>
<body>
<div id="teljeslap">
	<div id="fejlec">
		<?php
		if($this->Session->read('Auth.User.id')){
			print '<div id="logout">';
			print $this->Html->link($this->Html->image('hibajelzo.png'),
										'http://code.google.com/p/laksmi/issues/list',
										array('title' => 'Hibajelzés', 'escape' => false)
										);
			print $this->Html->link($this->Html->image('logout.png'),
								array(
									'controller' => 'users',
									'action' => 'logout'
								),
								array(
									'title' => 'Kijelentkezem', 'escape' => false
								));
			print '</div>';
		}
		print $this->Html->link($this->Html->image('logo.png'), '/', array('escape' => false));
		?>
		<div id="menuButtons">
			<?php
			if($this->Session->read('Auth.User.id')){
				print $this->Html->link($this->Html->image('vezerlo.png', array('class' => 'vimg')),
									array(
										'controller' => 'bizonylatok',
										'action' => 'index'
									),
									array(
										'title' => 'Vezérlőpult', 'escape' => false
									),
									null,
									false);
			print $this->Html->link($this->Html->image('ue.png', array('class' => 'vimg')),
									array(
										'controller' => 'bizonylatok',
										'action' => 'ue'
									),
									array(
										'title' => 'Ue kintlévő', 'escape' => false
									),
									null,
									false);
			print $this->Html->link($this->Html->image('lekerdezes.png', array('class' => 'vimg')),
									array(
										'controller' => 'bizonylatok',
										'action' => 'lekerdezes'
									),
									array(
										'title' => 'Lekérdezések', 'escape' => false
									),
									null,
									false);
			print $this->Html->link($this->Html->image('penzkeszlet.png', array('class' => 'vimg')),
									array(
										'controller' => 'bizonylatok',
										'action' => 'penzkeszlet'
									),
									array(
										'title' => 'Pénzkészlet', 'escape' => false
									),
									null,
									false);
			print $this->Html->link($this->Html->image('kt.png', array('class' => 'vimg')),
									array(
										'controller' => 'bizonylatok',
										'action' => 'kt'
									),
									array(
										'title' => 'K/T', 'escape' => false
									),
									null,
									false);
			print $this->Html->link($this->Html->image('beszamolo.png', array('class' => 'vimg')),
									array(
										'controller' => 'riportok',
										'action' => 'beszamolo'
									),
									array(
										'title' => 'Beszámoló', 'escape' => false
									),
									null,
									false);
			?></div>
		<?php
		print '<ul id="uci">';
         print '<li>';
            print $this->Html->link($this->Session->read('Auth.User.nev'), array('controller' => 'users', 'action' => 'edit'));
         print '</li>';
         if($this->Session->read('Auth.User.locked')){
            print '<li>';
            print ' ' . $this->Html->link('(' . $this->Session->read('Auth.User.locked') . ')',
													array(
															'controller' => 'users',
															'action' => 'removelock'
															),
													array(
															'class' => 'alert',
															'style' => 'font-size: 0.8em;',
															'title' => 'A rendszer sikertelen bejelentkezési kísérletet naplózott. A figyelmeztetés megszüntetéséhez kattints ide!'
															)) . ' ';
            print '</li>';
         }
         print '<li id="cegNev">';
            print ' / ' . $this->Session->read('Settings.cegNev') . ' / ' . $this->Session->read('Settings.ev');
            print '<ul id="cegUl" style="display:none;">';
            foreach($this->Session->read('Settings.cegek') as $ceg){
               print '<li>';
               print $ceg['Gyujto']['nev'];
                  print '<ul class="cegEvek">';
                     foreach($ceg['Gyujto']['evek'] as $ev){
                        print '<li class="fl">';
                           print $this->Html->link($ev, array(
														'controller' => 'gyujtok',
														'action' => 'ceg/' . $ceg['Gyujto']['id'] . '/' . $ev));
                        print '</li>';
                     }
                  print '</ul>';
               print '</li>';
            }
            print '</ul>';
         print '</li>';
      print '</ul>';
      }
      ?>
		</div>
	</div>
   
	<div id="tartalom">
		<?php
			print $this->Session->flash();
			print $this->Session->flash('auth');
			print $this->fetch('content');
		?>
	</div>


	<div id="lablec">
		<?php //print $this->element('sql_dump'); ?>
		<div id="lablecMessage"></div>
		<script type="text/javascript" language="javascript">
			if(navigator.userAgent.search(/firefox/gi) == -1)
				$('lablecMessage').update('<div class="warn">A laksmi működéséhez Firefox böngésző szükséges. Más böngészőkkel lehet, hogy nem fog minden működni.</div>');
		</script>
	</div>
	
	<div id="uzenet" style="display:none;">
		<span class="notifyClose"></span>
		<span id="uzenetBox"></span>
	</div>	
</div>
</body>
</html>
